package jiwei.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.net.MalformedURLException;
import java.util.List;

//Referer拦截器
//@Component
public class FileInterceptor implements HandlerInterceptor {
    Logger log = LoggerFactory.getLogger(getClass());

    //是否启用拦截。默认不启用
    @Value("${referer.enabled:false}")
    private Boolean referer_enabled;
    //白名单域名。支持配置多个域名，以,分隔。
    @Value("${referer.domains:}")
    private List<String> referer_domains;

    @Override
    public boolean preHandle(HttpServletRequest req, HttpServletResponse resp, Object handler) throws Exception {

        return true;
    }
}
